/*
 * SecureHash.h
 *
 *  Created on: Sep 15, 2011
 *      Author: Gherman Alin
 */

#ifndef CRYPTO__SECUREHASH_H_
#define CRYPTO__SECUREHASH_H_

#include <string>

namespace Crypto {

class SecureHash {
public:

public:
	/**
	 * should return a 256bit (unsigned char[32]) hash
	 */
	static unsigned int hash256(const std::string& data, std::string& out);

	/**
	 * should return a 512bit (unsigned char[64]) hash
	 */
	static unsigned int hash512(const std::string& data, std::string& out);

	/**
	 * should return a 256bit (unsigned char[32]) hash
	 */
	static unsigned int hash256(const char* data, size_t size,
			unsigned char* out);
	/**
	 * should return a 512bit (unsigned char[64]) hash
	 */
	static unsigned int hash512(const char* data, size_t size,
			unsigned char* out);

private:
	const static char* SHA256;
	const static char* SHA512;

	static unsigned int hash(const char *mode, const char* dataToHash,
			size_t dataSize,
			unsigned char* outHashed);

	static unsigned int hash(const char *mode, const std::string& dataToHash,
			std::string& outHashed);

private:
	SecureHash();
};

} /* end of namespace */
#endif /* SECUREHASH_H_ */
